package com.wtf.generator.dao;


import com.baomidou.mybatisplus.annotation.DbType;
import com.wtf.generator.annatation.DbTypeFlag;
import lombok.extern.slf4j.Slf4j;
import org.postgresql.Driver;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
/**
 * date: 2022/6/18 10:59
 * @author linhuanyou
 * @email 496558736@qq.com
 * @version 1.0
 */
@Slf4j
@DbTypeFlag(dbType = DbType.POSTGRE_SQL)
@Component
public class PgSqlGeneratorDao extends AbstractGeneratorDao {

    private String jdbcUrl = "jdbc:postgresql://%s:%d/%s";

    private String driverClass = "org.postgresql.Driver";

    @Override
    protected String getDriver() {
        return driverClass;
    }

    @Override
    protected String getUrl(String host, Integer port, String dbName) {
        return String.format(jdbcUrl,host, port, dbName);
    }

}
